package com.mdp.im.core.subscriber.action.impl;

import com.alibaba.fastjson.JSONObject;
import com.mdp.im.core.scbscriber.api.action.ScbscriberAction;
import com.mdp.im.core.socket.ChannelsHolder;
import com.mdp.im.core.subscriber.action.AbstractSubscriberAction;
import org.springframework.stereotype.Service;

/**
 * 群组被删除处理器
 * 
 * @author chenyc
 * @date 2018/6/12
 */
@Service
public class ChannelGroupRemoveAction extends AbstractSubscriberAction implements ScbscriberAction {

    /**
     * 处理消息
     * 
     * 
     * @param message
     */
    @Override
    public void doAction(JSONObject message) {
        JSONObject json = message;
        String groupId=json.getString("groupId");
        
        super.handleMessageWithGroup(message,true,groupId);
        
        ChannelsHolder.removeGroup(groupId);
    }

}
